<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
  <!ENTITY dc "http://purl.org/dc/elements/1.1/">
  <!ENTITY dcterms "http://purl.org/dc/terms/">
  <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
  <!ENTITY a "http://xmlns.heustics.org/schema/myelin/0.1/">
  <!ENTITY m "http://xmlns.heustics.org/ontology/myelin/0.1/">
]>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xf="http://www.w3.org/2002/xforms" 
  xmlns:a="http://xmlns.heustics.org/schema/myelin/0.1/"  
  xmlns:p="http://xmlns.heustics.org/schema/myelin/0.1/AgentAccount#"
  xmlns:u="http://xmlns.heustics.org/schema/myelin/0.1/UserAccount#"
  xmlns:o="http://xmlns.heustics.org/schema/myelin/0.1/UserAccount#edit-preferences"
  xmlns:l="http://xmlns.heustics.org/schema/i18n/0.1/"
  xmlns:fhttp="http://xmlns.4suite.org/4ss/http"
  extension-element-prefixes="fhttp" 
  exclude-result-prefixes="xsl xf a u p o l"
>   
  <xsl:variable name="o:l10n" select="a:get-l10n('&a;UserAccount#preferences')"/>
  <xsl:variable name="o:titles-l10n" select="$o:l10n/l:context[@name='titles']/*"/>
  
  <xsl:template match="a:title[@key='edit-preferences']" mode="a:head-content">
    <xsl:call-template name="a:head-title">
      <xsl:with-param name="title" select="$o:titles-l10n[1]"/>
    </xsl:call-template>
  </xsl:template>
  
  <xsl:template match="a:title[@key='edit-preferences']" mode="a:page-header">
    <xsl:call-template name="a:page-header-title">
      <xsl:with-param name="title" select="$o:titles-l10n[1]"/>
    </xsl:call-template>
  </xsl:template>   
  
   <xsl:template match="a:agent" mode="a:input-show">    
    <xsl:apply-templates select="a:nick|a:name" mode="a:input-show"/>
  </xsl:template>   
  
  <xsl:template match="a:nick" mode="a:input-show"> 
    <xsl:call-template name="p:nick-input">
      <xsl:with-param name="params-l10n" select="$u:params-l10n"/>
      <xsl:with-param name="hints-l10n" select="$u:hints-l10n"/>
      <xsl:with-param name="read-only" select="1"/>
    </xsl:call-template>
  </xsl:template>  
  
  <xsl:template match="a:name" mode="a:input-show"> 
    <xsl:call-template name="p:name-input">
      <xsl:with-param name="read-only" select="1"/>
    </xsl:call-template>
  </xsl:template>  
  
  <xsl:template match="a:form[@mode='main' and @status='commit-success']">
    <xsl:variable name="inst" select="xf:model[1]/xf:instance/*"/>
    <fhttp:response-uri
      uri='{a:format-url-ext(
        a:format-url-target-action(
          a:format-url-target(
            a:format-repeat-request(),
            @target
          ),
          @target-action
        ),
        "msg","preferences-updated"
      )}'/>
  </xsl:template>
  
</xsl:stylesheet>

